function diluteRawData(data, xinterval, saveCount = 10000) {
    const compressFactor = Math.ceil(data.length / saveCount)
    const count = Math.ceil(data.length / compressFactor)
    let result = []
    let item = null
    //每次取压缩比*2个数据
    for (
        let i = 0, length = data.length;
        i < length;
        i = i + compressFactor * 2
    ) {
        //越界
        let x = i + compressFactor * 2
        if (x > data.length) {
            const diff = x - data.length
            x = i + diff
        }
        let max = MIN_SAFE_INTEGER
        let min = MAX_SAFE_INTEGER
        let maxIndex = 0
        let minIndex = 0
        for (let j = i; j < x; j++) {
            item = data[j]
            if (!item && item != 0) {
                break
            }
            if (item > max) {
                maxIndex = j
                max = item
            }
            if (item < min) {
                minIndex = j
                min = item
            }
        }
        if (maxIndex > minIndex) {
            if (max != MIN_SAFE_INTEGER && min != MAX_SAFE_INTEGER) {
                result.push([
                    minIndex * xinterval.toFixed(3) * 1.0,
                    data[minIndex].toFixed(3) * 1.0
                ])
                result.push([
                    maxIndex * xinterval.toFixed(3) * 1.0,
                    data[maxIndex].toFixed(3) * 1.0
                ])
            }
        } else if (maxIndex == minIndex) {
            result.push([
                minIndex * xinterval.toFixed(3) * 1.0,
                data[minIndex].toFixed(3) * 1.0
            ])
        } else {
            if (max != MIN_SAFE_INTEGER && min != MAX_SAFE_INTEGER) {
                result.push([
                    maxIndex * xinterval.toFixed(3) * 1.0,
                    data[maxIndex].toFixed(3) * 1.0
                ])
                result.push([
                    minIndex * xinterval.toFixed(3) * 1.0,
                    data[minIndex].toFixed(3) * 1.0
                ])
            }
        }
    }}
